#include<stdio.h>
#include<stdlib.h>
#include<windows.h>
#include"mywindows.h"
#include"game.h"


#include"game2.h"

#include <mmsystem.h>
#pragma comment (lib,"winmm.lib")

//游戏音乐

int main()
{
    SetConsoleTitle("贪玩蓝月，是兄弟就来砍我");
//关闭之前的音乐
    mciSendString("close .\\music\\siye.mp3", NULL, 0, NULL);
    mciSendString("close .\\music\\sun.mp3", NULL, 0, NULL);
    mciSendString("close .\\music\\8bit.mp3", NULL, 0, NULL);
    //开始播放新音乐
    mciSendString(TEXT("play .\\music\\pink.mp3 repeat"), NULL, 0, NULL);

   Action();

    char a=getch();

    system("cls");
    if(a=='f'||a=='F')
{
    mciSendString("close .\\music\\pink.mp3", NULL, 0, NULL);

    mciSendString("open .\\music\\.8bit.mp3", NULL, 0, NULL);
    mciSendString(TEXT("play .\\music\\8bit.mp3 repeat"), NULL, 0, NULL);
    initGame();
    //mciSendString("stop play", NULL, 0, NULL);
}
else if(a=='j'||a=='J')
{
    mciSendString("close .\\music\\siye.mp3", NULL, 0, NULL);
    mciSendString("close .\\music\\pink.mp3", NULL, 0, NULL);
    mciSendString(TEXT("play .\\music\\sun.mp3 repeat"), NULL, 0, NULL);
    printf("'w''s''a''d'控制上下左右\n蛇越长跑得越快~~~\n");
    printf("按任意键开始\n");
    char ch = _getch();
    system("cls");
    ini();
    show();
}


    mciSendString("close .\\music\\sun.mp3", NULL, 0, NULL);
    mciSendString("close .\\music\\8bit.mp3", NULL, 0, NULL);
    mciSendString("close .\\music\\pink.mp3", NULL, 0, NULL);
    mciSendString(TEXT("play .\\music\\bye.mp3 repeat"), NULL, 0, NULL);
printC();
    //打印结束



return 0;
}
